import { GCellRenderer } from "../../../../com/mui/controls/GCellRenderer";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { SkillItem } from "../skill/SkillItem";
import { SkillInfo } from "../../model/SkillInfo";
import { SkillConfig } from "../../resource/SkillConfig";
import { FilterConst } from "../../../component/gconst/FilterConst";
import { ToolTipInfo } from "../../model/ToolTipInfo";
type int = number;
//class SpiritSkillRenderer
    
    export  class SpiritSkillRenderer extends GCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ configUI(): void
        {
            this._bg = ObjCreate.createBitmap(ImagesConst.PackItemBg, 0, 0, this);
            this._item = new SkillItem();
            this._item.move(3, 3);
            this._item.setSize(36, 36);
            addChild(this._item);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            var loc1=0;
            var loc2=false;
            var loc3=null;
            super.data = arg1;
            if (arg1) 
            {
                loc1 = arg1.skillId as int;
                loc2 = arg1.isEnable as Boolean;
                (loc3 = new SkillInfo()).tSkill = SkillConfig.instance.getInfoByName(loc1);
                this._item.data = loc3;
                this._item.toolTipDataFunction = this.getToolTipData;
                if (loc2) 
                {
                    this._item.filters = [];
                }
                else 
                {
                    this._item.filters = [FilterConst.colorFilter2];
                }
            }
            return;
        }

        /* internal  */getToolTipData(arg1: SkillItem): ToolTipInfo
        {
            return (arg1.data as SkillInfo).getToolTipInfo();
        }

        /* internal */ /* var */_bg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_item: SkillItem;
    }
